package com.drcoffee.drcoffeemall.mapper;

import com.drcoffee.drcoffeemall.entry.Machine;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;


/*
 * 机器
 * */
@Mapper
@Repository
public interface MachineMapper {
    /*
     * 查询机器
     * */
    List<Machine> getMachine(Integer type_id, String search);

    /*
     * 查询机器All
     * */
//    List<Machine> getMachineAll(Machine machine);
    List<Machine> getMachineAll(String name);

    /*
     * 根据id查询机器
     * */
    Machine getMachineById(Integer id);


    boolean updateMachine(Machine machine);

    boolean updateMachineText(Machine machine);


    void insertData(Map<String, Object> machine);


    @Select("SELECT type_id FROM t_machine WHERE id = #{machineId}")
    Integer getMachineTypeId(Integer machineId);
}
